package com.dachuang.canjiren.controller;

import com.dachuang.canjiren.service.PolicyService;
import com.dachuang.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2020-07-27
 */
@RestController
@RequestMapping("/canjiren/policy")
public class PolicyController {
    @Autowired
    private PolicyService policyService;

    @GetMapping(value = "insertPolicy")
    R insertPolicy(@RequestParam(value = "theme", required = false) String theme,
                   @RequestParam(value = "content", required = false) String content) {
        return policyService.insertPolicy(theme, content);
    }

    @GetMapping(value = "selectPolicy")
    R sPolicy(@RequestParam(value = "id", required = false) Integer id) {
        return policyService.selectPolicy(id);
    }
}

